import { PromptTemplate } from "@langchain/core/prompts";

// 定义一个函数，获取当前的日期
const getToday = () => new Date().toLocaleDateString();

const pt = PromptTemplate.fromTemplate("今天是{date}，今天的活动是：{event}");

const pt2 = await pt.partial({
  date: getToday,
});

const result = await pt2.format({
  event: "出去郊游",
});
console.log(result);
